export function pinbu(arr) {
  const obj = {}
  arr.forEach(item => {
    if (!item.children) {
      item.children = []
    }
    obj[item.id] = item
  })
  //    console.log(obj);
  const nuwArr = []
  arr.forEach(item => {
    const porm = obj[item.pid]
    if (porm) {
      porm.children.push(item)
    } else {
      nuwArr.push(item)
    }
  })

  return nuwArr
}
